package za.co.yellowfire.domain;

import za.co.yellowfire.solarflare.annotation.SearchableProperty;

import java.io.Serializable;

/**
 * @author Mark P Ashworth
 */
public class Name implements Serializable {
    private static final long serialVersionUID = 1L;

    @SearchableProperty(name = "name")
    private String firstName;

    @SearchableProperty(dynamic = true)
    private String lastName;

    /**
     * Default constructor
     */
    public Name() {}

    /**
     * Constructs the new name
     * @param firstName The first name
     * @param lastName The last name
     */
    public Name(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
    }

    /**
     * Returns the first name
     * @return String
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * Sets the first name
     * @param firstName The new value
     */
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    /**
     * Returns the last name
     * @return String
     */
    public String getLastName() {
        return lastName;
    }

    /**
     * Sets the last name
     * @param lastName The new value
     */
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    /**
     * Returns a string representation of the object
     * @return String
     */
    @Override
    public String toString() {
        return "Name{" +
                "firstName='" + firstName + '\'' +
                ", lastName='" + lastName + '\'' +
                '}';
    }
}
